package com.example.cr.generator.enums;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;

public enum IdentificationStatus {
    PENDING("P", "待确认"),
    CONFIRMED("C", "已确认"),
    REJECTED("R", "已拒绝"),
    REVIEWED("V", "已审核");

    private String code;
    private String desc;

    IdentificationStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static List<HashMap<String, String>> getEnumList() {
        List<HashMap<String, String>> list = new ArrayList<>();
        for (IdentificationStatus anEnum : EnumSet.allOf(IdentificationStatus.class)) {
            HashMap<String, String> map = new HashMap<>();
            map.put("code", anEnum.code);
            map.put("desc", anEnum.desc);
            list.add(map);
        }
        return list;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "IdentificationStatus{" +
                "code='" + code + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}